package com.agregatesdk.core;

import android.app.Activity;
import android.os.Bundle;

import com.agregatesdk.point.PointManager;
import com.agregatesdk.recommender.RecommenderSwither;

public class FczFilter {

	private static float signal = 0;
	
	public static void handleData(Activity context) {
		
		Bundle bundle = context.getIntent().getExtras();
		if (bundle != null) {
			signal = bundle.getInt("fcz_signal");
		}
		
	}
	
	public static void check(Activity context){
		
		UserAccount.getInstance().init(context);
		
		if (signal > 0 && PointManager.getUserTotalCredit(context) < signal) {
			// 任务模式
			new SDKListView(context, PointManager.getUserTotalCredit(context), signal).show();
			signal = 0;
		} else if (signal == 0) {
			// 激活模式
			RecommenderSwither.check(context);
		}
	}
	
}
